package com.qfedu.food.controller;


import com.qfedu.food.pojo.TBuyCourse;
import com.qfedu.food.service.TBuyCourseService;
import com.qfedu.food.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @auther BUG小能手
 * @date 2021/1/11 21:19
 */

@RestController
@RequestMapping("/api/buycourse/")
@Api(tags = "实现购买课程的各种操作")
public class TBuyCourseController {

    @Autowired
    private TBuyCourseService tBuyCourseService;


    /*
     * 会员用户查询展示所有数据*/
    @ApiOperation(value = "实现全部查询",notes = "实现全部查询")
    @GetMapping("all")
    public R all() {
        return tBuyCourseService.findAll();
    }


    /*
     * 会员用户添加购买视频*/
    @ApiOperation(value = "实现添加",notes = "实现添加")
    @PutMapping("add")
    public R addCourse(@RequestBody TBuyCourse tBuyCourse) {
        tBuyCourseService.addCourse(tBuyCourse);
        return R.ok();
    }

}
